home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / bbsutil / hsrc_117.zip / STRISTR.C < prev    next >
Text File  |  1990-08-21  |  361b  |  26 lines

  1. #include "stddef.h"
  2.  
  3.  
  4. /* insensitive instr() for Turbo C */
  5.  
  6. char * pascal stristr (char *t, char *s) {
  7.  
  8.    char *t1;
  9.    char *s1;
  10.  
  11.    while(*t) {
  12.       t1=t;
  13.       s1=s;
  14.       while(*s1) {
  15.          if (toupper(*s1)!=toupper(*t)) break;
  16.          else {
  17.             s1++;
  18.             t++;
  19.          }
  20.       }
  21.       if (!*s1) return t1;
  22.       t=t1+1;
  23.    }
  24.    return NULL;
  25. }
  26.